/**
*@author       wuwg
*@createTime   2018/03/20
*@updateTime   2018/03/20
*@description
*@rule
 */
@import '../../../config/config.less';
@import '../../../mixins/size/index.less';

@css-prefix-tag: ~"@{css-prefix}tag";
@css-prefix-tag-close: ~"@{css-prefix}icon-ios-close-empty";

.@{css-prefix-tag} {
  display: inline-block;
  height: 22px;
  line-height: 22px;
  margin: 2px 4px 2px 0;
  padding: 0 8px;
  border: 1px solid @border-color-split;
  border-radius: @btn-border-radius-small;
  background: @background-color-base;
  font-size: @tag-font-size;
  vertical-align: middle;
  opacity: 1;
  overflow: hidden;
  cursor: pointer;
  //transition: all @transition-time @ease-in-out;

  // for color and unchecked
  &:not(&-border):not(&-dot):not(&-checked){
    background: transparent;
    border-color: transparent;
    color: @text-color;
    .@{css-prefix-tag-close} {
      color: @text-color !important;
    }
  }

  &-color{
    &-red{
      color: @error-color !important;
      border-color: @error-color;
    }
    &-green{
      color: @success-color !important;
      border-color: @success-color;
    }
    &-blue{
      color: @link-color !important;
      border-color: @link-color;
    }
    &-yellow{
      color: @warning-color !important;
      border-color: @warning-color;
    }
    &-white{
      color: rgb(255, 255, 255) !important;
    }
  }

  &-dot{
    height: 32px;
    line-height: 32px;
    border: 1px solid @border-color-split !important;
    color: @text-color !important;
    background: #fff !important;
    padding: 0 12px;

    &-inner{
      display: inline-block;
      width: 12px;
      height: 12px;
      margin-right: 8px;
      border-radius: 50%;
      background: @border-color-split;
      position: relative;
      top: 1px;
    }
    .@{css-prefix-tag-close} {
      color: #666 !important;
      margin-left: 12px !important;
    }
  }

  &-border{
    height: 24px;
    line-height: 24px;
    border: 1px solid @border-color-split;
    color: @border-color-split;
    background: #fff !important;
    position: relative;

    .@{css-prefix-tag-close} {
      color: #666;
      margin-left: 12px !important;
    }

    &:after{
      content: "";
      display: none;
      width: 1px;
      background: currentColor;
      position: absolute;
      top: 0;
      bottom: 0;
      right: 22px;
    }

    &.@{css-prefix-tag}-closable {
      &:after{
        display: block;
      }
      .@{css-prefix-tag-close} {
        margin-left: 18px !important;
      }
    }

    &.@{css-prefix-tag}-blue {
      color: @link-color !important;
      border: 1px solid @link-color !important;

      &:after{
        background: @link-color;
      }
      .@{css-prefix-tag-close}{
        color: @link-color !important;
      }
    }
    &.@{css-prefix-tag}-green {
      color: @success-color !important;
      border: 1px solid @success-color !important;

      &:after{
        background: @success-color;
      }
      .@{css-prefix-tag-close}{
        color: @success-color !important;
      }
    }
    &.@{css-prefix-tag}-yellow {
      color: @warning-color !important;
      border: 1px solid @warning-color !important;

      &:after{
        background: @warning-color;
      }
      .@{css-prefix-tag-close}{
        color: @warning-color !important;
      }
    }
    &.@{css-prefix-tag}-red {
      color: @error-color !important;
      border: 1px solid @error-color !important;

      &:after{
        background: @error-color;
      }
      .@{css-prefix-tag-close}{
        color: @error-color !important;
      }
    }
  }

  &:hover {
    opacity: 0.85;
  }

  &,
  a,
  a:hover {
    // color: @text-color;
  }

  &-text {
    a:first-child:last-child {
      display: inline-block;
      margin: 0 -8px;
      padding: 0 8px;
    }
    color: @text-color;
  }

  .@{css-prefix-tag-close} {
    .iconfont-size-under-12px(20px);
    cursor: pointer;
    margin-left: 8px;
    color: #666;
    opacity: 0.66;
    position: relative;
    top: 1px;
    //transition: all @transition-time @ease-in-out;

    &:hover {
      opacity: 1;
    }
  }

  &-blue,
  &-green,
  &-yellow,
  &-red {
    border: 0;
    &,
    a,
    a:hover,
    .@{css-prefix-tag-close},
    .@{css-prefix-tag-close}:hover {
      color: #fff;
    }
  }

  &-blue,
  &-blue&-dot &-dot-inner
  {
    background: @link-color;
  }

  &-green,
  &-green&-dot &-dot-inner
  {
    background: @success-color;
  }

  &-yellow,
  &-yellow&-dot &-dot-inner
  {
    background: @warning-color;
  }

  &-red,
  &-red&-dot &-dot-inner
  {
    background: @error-color;
  }
}
